package team.yidong.fenda.repository;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import team.yidong.fenda.entity.Hospital;
import team.yidong.fenda.entity.HospitalField;

import java.util.List;

/**
 * Created by xuanlong on 2017/10/16.
 */
public interface HospitalFieldRepository extends JpaRepository<HospitalField, Integer>, JpaSpecificationExecutor<HospitalField> {
    @Query("select field from HospitalField field join field.hospital hospital where hospital.id=?1")
    List<HospitalField> findHospitalFieldByHospital(Integer hospitalId);

}
